package com.eliza.base

import android.content.Intent
import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.eliza.base.compoment.SplashBgThree
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity() : ComponentActivity() {
    @Inject
    lateinit var aa: TestA
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            Log.e("AAAAAAA", aa.asd)
            SplashBgThree()
        }
        // kotlin 协程阻塞
        CoroutineScope(Dispatchers.Main).launch {
            delay(400L)
            startActivity(Intent(this@MainActivity, RoutingActivity::class.java))
            finish();
        }
    }

}

class TestA @Inject constructor() {
    val asd = "TestA Inject"
}